home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
SUBUNTIL.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
2KB
|
68 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_SubUntil( cStr, cFromText, cToText ) --> cString
PARAMETERS:
cStr : String to extract from
cFromText : String after which to begin extracting cToText
cToText : String to stop extracting at when encountered
SHORT:
Return substring between two tokens in a string.
DESCRIPTION:
_SubUntil() takes an input string and begins extracting a string
immediatly AFTER the cFromText label up to, but not including the
cToText string. It is useful for extracting a parameter or substring
from another string when you do not know the exact position of the
desired substring, only that it follows "some text" and ends at some
text (most likely a white-space character). _SubUntil() IS case sensitive.
If case is unknown, you should lower() or upper() the input strings.
An end of string condition will return the string from the requested start
position up to the end of the string.
If cFromText is empty, the return string begins at the beginning of cStr
(ie, the first character).
If cToText is empty, the return string includes everything from the
starting position up to AND including the last character of cStr.
Thus, if both cFromText and cToText are empty (or NIL) then _SubUntil()
will return the entire string.
RETURNS: Sub-String that occurs BETWEEN two delimiting strings.
NOTE:
EXAMPLE:
_SubUntil('Name: Kirby L. Wallace','Name: ',' ')
Returns: "Kirby"
_SubUntil('Name: Kirby L. Wallace','L. ',' ')
Returns: "Wallace" even though the cToText never occured
? _SubUntil('Kirby L. Wallace',,'L.')
Returns: "Kirby" (cToText defaulted to <beginning of string>)
? _SubUntil('Kirby L. Wallace','Kirby','Wallace')
Returns: " L. " // note spaces!
? _SubUntil('Kirby L. Wallace','L. ') // Note SPACE in "L. "
Returns: "Wallace"
? _SubUntil('Kirby L. Wallace')
Returns: "Kirby L. Wallace"
******************************************************************************/